$(function(){
	Z.tab($('ul.tab-button a'), $('div.platform'), ['active','']);

	$('.platform').each(function(){
		var main_image = $(this).find('input[name$=main_image]'),
			detail_images = $(this).find('input[name$=detail_images]');

		if(main_image.length > 0){
			new Z.ImageBrowser(main_image);
		}

		if(detail_images.length > 0){
			new Z.ImageBrowser(detail_images,Z.ImageBrowser.MULTIPLE);
		}
	});

	$('form:eq(0)').submit(function(){
		Z.ajax({
			url : $(this).attr('action'),
			type: $(this).attr('method'),
			data: $(this).serialize()
		});
		return false;
	});
});